package com.phpxiu.app.supports.qq;

import android.os.Bundle;

import com.tencent.connect.share.QQShare;

/**
 * @file
 * @brief 分享到QQ好友内容结构
 * @author 吴金洲
 * @note  分享到QQ好友内容结构
 *
 */
public class QQShareContent {
    public Bundle content=new Bundle();

    /**
     * 默认只分享到QQ好友
     */
    public QQShareContent(String title,String targetUrl) {
        content.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
        content.putString(QQShare.SHARE_TO_QQ_TITLE, title);
        content.putString(QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl);
        content.putInt(QQShare.SHARE_TO_QQ_EXT_INT, QQShare.SHARE_TO_QQ_FLAG_QZONE_ITEM_HIDE);
    }

    /**
     * 默认只分享到QQ好友
     */
    public QQShareContent(String title,String targetUrl,String appName) {
        this(title,targetUrl);
        this.content.putString(QQShare.SHARE_TO_QQ_APP_NAME, appName);
    }
    /**
     * 设置分享文字内容
     */
    public void setSummary(String summary){
        this.content.putString(QQShare.SHARE_TO_QQ_SUMMARY, summary);
    }

    /**
     * 分享图片
     */
    public void setImageUrl(String imageUrl){
        this.content.putString(QQShare.SHARE_TO_QQ_IMAGE_URL,imageUrl);
    }

    /**
     * 设置app名称
     */
    public void setAppName(String appName){
        this.content.putString(QQShare.SHARE_TO_QQ_APP_NAME, appName);
    }

    /**
     * 分享app
     */
    public void isShareApp(){
        this.content.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_APP);
    }

    public void isOpenQQZone(){
        content.putInt(QQShare.SHARE_TO_QQ_EXT_INT, QQShare.SHARE_TO_QQ_FLAG_QZONE_AUTO_OPEN);
    }

}
